﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Configuration;

namespace Utilities
{
    public static class MyConfig
    {
        public static int PageSize
        {
            get
            {
                try
                {
                    return int.Parse(WebConfigurationManager.AppSettings["PageSize"].ToString());
                }
                catch { }
                return 20;
            }
        }

        public static string DateFormat
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["DateFormat"].ToString();
                }
                catch { }
                return "dd/MM/yyyy";
            }
        }

        public static string DateTimeFormat
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["DateTimeFormat"].ToString();
                }
                catch { }
                return "dd/MM/yyyy hh:mm:ss tt";
            }
        }

        public static string CurrencyFormat
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["CurrencyFormat"].ToString();
                }
                catch { }
                return "#,##0 đồng";
            }
        }

        public static string NumberFormat
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["NumberFormat"].ToString();
                }
                catch { }
                return "#,##0";
            }
        }

        public static int NullNumber
        {
            get
            {
                try
                {
                    return Convert.ToInt32(WebConfigurationManager.AppSettings["NullNumber"].ToString());
                }
                catch { }
                return -1;
            }
        }

        public static string ReceivingDateAgoCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["ReceivingDateAgoCode"].ToString();
                }
                catch { }
                return "ReceivingDateAgo";
            }
        }

        public static string RepairingStatusIDCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["RepairingStatusIDCode"].ToString();
                }
                catch { }
                return "RepairingStatusID";
            }
        }

        public static string RepairNoCompleteIDCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["RepairNoCompleteIDCode"].ToString();
                }
                catch { }
                return "RepairNoCompleteID";
            }
        }

        public static string UpdateReceivedInfoCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["UpdateReceivedInfoCode"].ToString();
                }
                catch { }
                return "UpdateReceivedInfo";
            }
        }

        public static string RepairingTypeIsWarrantyIDCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["RepairingTypeIsWarrantyIDCode"].ToString();
                }
                catch { }
                return "RepairingTypeIsWarrantyID";
            }
        }

        public static string SeparateStringCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["SeparateStringCode"].ToString();
                }
                catch { }
                return "SeparateString";
            }
        }

        public static string PageSizeCookiesName
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["PageSizeCookiesName"].ToString();
                }
                catch { }
                return "PageSize";
            }
        }

        public static string CurrentPageIndexCookiesName
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["CurrentPageIndexCookiesName"].ToString();
                }
                catch { }
                return "CurrentPageIndex";
            }
        }

        public static string ReportDateAgoCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["ReportDateAgoCode"].ToString();
                }
                catch { }
                return "ReportDateAgo";
            }
        }

        public static string RepairingLocationAtHomeIDCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["RepairingLocationAtHomeIDCode"].ToString();
                }
                catch { }
                return "RepairingLocationAtHomeID";
            }
        }

        public static string RepairingLocationAtStationIDCode
        {
            get
            {
                try
                {
                    return WebConfigurationManager.AppSettings["RepairingLocationAtStationIDCode"].ToString();
                }
                catch { }
                return "RepairingLocationAtStationID";
            }
        }

    }
}
